package com.yonyou.pmclouds.user.controller;


import com.yonyou.pmclouds.basecom.runtime.RuntimeEnvironment;
import com.yonyou.pmclouds.outter.user.UserInfoQuery;
import com.yonyou.pmclouds.user.entity.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    private UserInfoQuery userInfoQuery;

    @GetMapping(value = "/me")
    public UserInfo loginUserInfo() {
        return userInfoQuery.queryUser(RuntimeEnvironment.getLoginUserId());
    }

    @GetMapping(value = "/tenantId")
    public String loginTenantId() {
        return RuntimeEnvironment.getTenantId();
    }

}
